<?php
/**
  * Mar 12, 2008
  *
  * Coded by: Ropu
  *
  */
include 'login.php';
//print_r($_SESSION['hacker']);

if(isset($_GET['id'])) {
  try {
    $h = new Hackathon((int)$_GET['id']);
    $hackers = HackathonDAO::getByHackathon((int)$_GET['id']);
  } catch(Exception $e) {
    $h = new Hackathon(1);
    $hackers = HackathonDAO::getByHackathon(1);
  }
  $hackathon_name = $h->getLocation(); 
  if(!empty($hackers)) {
    include 'templates/temp_hackathon.php';
    die;  
  }
}

$hackathons = HackathonDAO::getList();
include 'templates/temp_hackathon_list.php';
